package com.example.spring;

import com.example.spring.bean.Order;
import com.example.spring.bean.Student;
import com.example.spring.bean.User;
import com.example.spring.bean.Vip;
import com.example.spring.dao.OrderDao;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:text
 * Package:com.example.spring
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/9-21:25
 * @Version:v1.0
 */
public class text {
    @Test
    public void test01() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
        User userBean = applicationContext.getBean("userBean", User.class);
        System.out.println(userBean);

        Order orderBean = applicationContext.getBean("orderBean", Order.class);
        System.out.println(orderBean);

        Vip vipBean = applicationContext.getBean("vipBean", Vip.class);
        System.out.println(vipBean);

        Student studentBean = applicationContext.getBean("student", Student.class);
        System.out.println(studentBean);

        OrderDao orderDao = applicationContext.getBean("orderDao", OrderDao.class);
        System.out.println(orderDao);
    }
}
